@extends('admin.layout')
@section('title',$title)
@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                评价列表
                
            </h1>
            <ol class="breadcrumb">
                <li><a href="/admin/comment/show"><i class="fa fa-dashboard"></i>评价列表 </a></li>
                </li>
            </ol>
        </section>
        <!-- 用户添加成功 -->
        @if (session('success'))
            <div class="alert alert-success alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                <h4><i class="icon fa fa-check"></i>恭喜!</h4>
                        {{ session('success') }}
            </div>
        @endif
<!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            {{--分页--}}
                            <!-- 搜索用户,和当前页面的数据数 -->
                            <form action="/admin/comment/show" method="get">
                            <div class="col-md-2">
                            <div class="form-group">
                                <select name="num" class="form-control">
                                <!-- 判断num的值,并选中 -->
                                    <option
                                    @if(!empty($request['num']) && $request['num'] == 10)
                                        selected
                                    @endif
                                    >10</option>
                                    <option
                                    @if(!empty($request['num']) && $request['num'] == 20)
                                        selected
                                    @endif
                                    >20</option>
                                    <option
                                    @if(!empty($request['num']) && $request['num'] == 50)
                                        selected
                                    @endif
                                    >50</option>
                                    <option
                                    @if(!empty($request['num']) && $request['num'] == 100)
                                        selected
                                    @endif
                                    >100</option>
                                </select>
                            </div>

                            </div>

                            <div class="col-md-3 col-md-offset-7">
                            <div class="input-group input-group-sm">
                                <input name="keywords" type="text" class="form-control" value="{{$request['keywords'] or ''}}">
                                <span class="input-group-btn">
                                  <button class="btn btn-info btn-flat">搜索!</button>
                                </span>
                            </div>
                            </div>
                            </form>
                        </div><!-- /.box-header -->
                        <!-- 用户列表 -->
                        <div class="box-body">
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>评价ID</th>
                                    <th>商品ID</th>
                                    <th>评价内容</th>
                                    <th>评价时间</th>
                                    <th>用户ID</th>
                                    <th>用户名</th>
                                    <th>用户IP</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $comment)
                                <tr>
                                    <td>{{$comment -> id}}</td>
                                    <td>{{$comment -> goods_id}}</td>
                                    <td>{{$comment -> content}}</td>
                                    <td>{{$comment -> atime}}</td>
                                    <td>{{$comment -> uid}}</td>
                                    <td>{{$comment -> uname}}</td>
                                    <td>{{$comment -> uip}}</td>

                                    <!-- 编辑和删除 -->
                                    <td><a href="/admin/reply/add/{{$comment -> id}}" class="btn btn-block btn-success">回复</a>
                                    <a href="/admin/comment/delete/{{$comment -> id}}" class="btn btn-block btn-danger">删除</a></td>
                                </tr>
                                @endforeach
                                </tfoot>
                            </table>
                            {!! $data->appends($request)->render() !!}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->


                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
@endsection
